package cn.new18.testactivitytask.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * Created by WangChao on 2016/12/28.
 */

public class RecommendDetailBean implements Parcelable{

    /**
     * code : 0
     * data : {"recommendsPm":[{"recommendId":96,"groupName":"股海擒牛","title":"赛升药业","stockCode":"","content":"赛升药业赛升药业赛升药业赛升药业赛升药业","releasedAt":1482909060,"productId":8,"stockName":"赛升药业"},{"recommendId":90,"groupName":"股海擒牛","title":"世纪星源世纪星源","stockCode":"","content":"世纪星源世纪星源世纪星源世纪星源世纪星源","releasedAt":1482909143,"productId":8,"stockName":"世纪星源"}],"recommendsAm":[{"recommendId":97,"groupName":"股海擒牛","title":"阿飞发达","stockCode":"000422","content":"啊时代发生的","releasedAt":1482891994,"productId":8,"stockName":"湖北宜化"}]}
     * message : success
     */

    private int code;
    private DataBean data;
    private String message;

    @Override
    public String toString() {
        return "RecommendDetailBean{" +
                "code=" + code +
                ", data=" + data +
                ", message='" + message + '\'' +
                '}';
    }

    protected RecommendDetailBean(Parcel in) {
        code = in.readInt();
        data = in.readParcelable(DataBean.class.getClassLoader());
        message = in.readString();

    }

    public static final Creator<RecommendDetailBean> CREATOR = new Creator<RecommendDetailBean>() {
        @Override
        public RecommendDetailBean createFromParcel(Parcel in) {
            return new RecommendDetailBean(in);
        }

        @Override
        public RecommendDetailBean[] newArray(int size) {
            return new RecommendDetailBean[size];
        }
    };

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public DataBean getData() {
        return data;
    }

    public void setData(DataBean data) {
        this.data = data;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeInt(code);
        parcel.writeParcelable(data, i);
        parcel.writeString(message);
    }

    public static class DataBean implements Parcelable{
        private List<RecommendsPmBean> recommendsPm;
        private List<RecommendsAmBean> recommendsAm;

        @Override
        public String toString() {
            return "DataBean{" +
                    "recommendsPm=" + recommendsPm +
                    ", recommendsAm=" + recommendsAm +
                    '}';
        }

        protected DataBean(Parcel in) {
            recommendsPm = in.createTypedArrayList(RecommendsPmBean.CREATOR);
            recommendsAm = in.createTypedArrayList(RecommendsAmBean.CREATOR);
        }

        public static final Creator<DataBean> CREATOR = new Creator<DataBean>() {
            @Override
            public DataBean createFromParcel(Parcel in) {
                return new DataBean(in);
            }

            @Override
            public DataBean[] newArray(int size) {
                return new DataBean[size];
            }
        };

        public List<RecommendsPmBean> getRecommendsPm() {
            return recommendsPm;
        }

        public void setRecommendsPm(List<RecommendsPmBean> recommendsPm) {
            this.recommendsPm = recommendsPm;
        }

        public List<RecommendsAmBean> getRecommendsAm() {
            return recommendsAm;
        }

        public void setRecommendsAm(List<RecommendsAmBean> recommendsAm) {
            this.recommendsAm = recommendsAm;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel parcel, int i) {
            parcel.writeTypedList(recommendsPm);
            parcel.writeTypedList(recommendsAm);
        }

        public static class RecommendsPmBean implements Parcelable{
            /**
             * recommendId : 96
             * groupName : 股海擒牛
             * title : 赛升药业
             * stockCode :
             * content : 赛升药业赛升药业赛升药业赛升药业赛升药业
             * releasedAt : 1482909060
             * productId : 8
             * stockName : 赛升药业
             */

            private int recommendId;
            private String groupName;
            private String title;
            private String stockCode;
            private String content;
            private int releasedAt;
            private int productId;
            private String stockName;

            @Override
            public String toString() {
                return "RecommendsPmBean{" +
                        "recommendId=" + recommendId +
                        ", groupName='" + groupName + '\'' +
                        ", title='" + title + '\'' +
                        ", stockCode='" + stockCode + '\'' +
                        ", content='" + content + '\'' +
                        ", releasedAt=" + releasedAt +
                        ", productId=" + productId +
                        ", stockName='" + stockName + '\'' +
                        '}';
            }

            protected RecommendsPmBean(Parcel in) {
                recommendId = in.readInt();
                groupName = in.readString();
                title = in.readString();
                stockCode = in.readString();
                content = in.readString();
                releasedAt = in.readInt();
                productId = in.readInt();
                stockName = in.readString();
            }

            public static final Creator<RecommendsPmBean> CREATOR = new Creator<RecommendsPmBean>() {
                @Override
                public RecommendsPmBean createFromParcel(Parcel in) {
                    return new RecommendsPmBean(in);
                }

                @Override
                public RecommendsPmBean[] newArray(int size) {
                    return new RecommendsPmBean[size];
                }
            };

            public int getRecommendId() {
                return recommendId;
            }

            public void setRecommendId(int recommendId) {
                this.recommendId = recommendId;
            }

            public String getGroupName() {
                return groupName;
            }

            public void setGroupName(String groupName) {
                this.groupName = groupName;
            }

            public String getTitle() {
                return title;
            }

            public void setTitle(String title) {
                this.title = title;
            }

            public String getStockCode() {
                return stockCode;
            }

            public void setStockCode(String stockCode) {
                this.stockCode = stockCode;
            }

            public String getContent() {
                return content;
            }

            public void setContent(String content) {
                this.content = content;
            }

            public int getReleasedAt() {
                return releasedAt;
            }

            public void setReleasedAt(int releasedAt) {
                this.releasedAt = releasedAt;
            }

            public int getProductId() {
                return productId;
            }

            public void setProductId(int productId) {
                this.productId = productId;
            }

            public String getStockName() {
                return stockName;
            }

            public void setStockName(String stockName) {
                this.stockName = stockName;
            }

            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel parcel, int i) {
                parcel.writeInt(recommendId);
                parcel.writeString(groupName);
                parcel.writeString(title);
                parcel.writeString(stockCode);
                parcel.writeString(content);
                parcel.writeInt(releasedAt);
                parcel.writeInt(productId);
                parcel.writeString(stockName);
            }
        }

        public static class RecommendsAmBean implements Parcelable{
            /**
             * recommendId : 97
             * groupName : 股海擒牛
             * title : 阿飞发达
             * stockCode : 000422
             * content : 啊时代发生的
             * releasedAt : 1482891994
             * productId : 8
             * stockName : 湖北宜化
             */

            private int recommendId;
            private String groupName;
            private String title;
            private String stockCode;
            private String content;
            private int releasedAt;
            private int productId;
            private String stockName;

            @Override
            public String toString() {
                return "RecommendsAmBean{" +
                        "recommendId=" + recommendId +
                        ", groupName='" + groupName + '\'' +
                        ", title='" + title + '\'' +
                        ", stockCode='" + stockCode + '\'' +
                        ", content='" + content + '\'' +
                        ", releasedAt=" + releasedAt +
                        ", productId=" + productId +
                        ", stockName='" + stockName + '\'' +
                        '}';
            }

            protected RecommendsAmBean(Parcel in) {
                recommendId = in.readInt();
                groupName = in.readString();
                title = in.readString();
                stockCode = in.readString();
                content = in.readString();
                releasedAt = in.readInt();
                productId = in.readInt();
                stockName = in.readString();
            }

            public static final Creator<RecommendsAmBean> CREATOR = new Creator<RecommendsAmBean>() {
                @Override
                public RecommendsAmBean createFromParcel(Parcel in) {
                    return new RecommendsAmBean(in);
                }

                @Override
                public RecommendsAmBean[] newArray(int size) {
                    return new RecommendsAmBean[size];
                }
            };

            public int getRecommendId() {
                return recommendId;
            }

            public void setRecommendId(int recommendId) {
                this.recommendId = recommendId;
            }

            public String getGroupName() {
                return groupName;
            }

            public void setGroupName(String groupName) {
                this.groupName = groupName;
            }

            public String getTitle() {
                return title;
            }

            public void setTitle(String title) {
                this.title = title;
            }

            public String getStockCode() {
                return stockCode;
            }

            public void setStockCode(String stockCode) {
                this.stockCode = stockCode;
            }

            public String getContent() {
                return content;
            }

            public void setContent(String content) {
                this.content = content;
            }

            public int getReleasedAt() {
                return releasedAt;
            }

            public void setReleasedAt(int releasedAt) {
                this.releasedAt = releasedAt;
            }

            public int getProductId() {
                return productId;
            }

            public void setProductId(int productId) {
                this.productId = productId;
            }

            public String getStockName() {
                return stockName;
            }

            public void setStockName(String stockName) {
                this.stockName = stockName;
            }

            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel parcel, int i) {
                parcel.writeInt(recommendId);
                parcel.writeString(groupName);
                parcel.writeString(title);
                parcel.writeString(stockCode);
                parcel.writeString(content);
                parcel.writeInt(releasedAt);
                parcel.writeInt(productId);
                parcel.writeString(stockName);
            }
        }
    }
}
